home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / X11 / config / OpenBSDLib.rules < prev    next >
Encoding:
Text File  |  2006-12-20  |  4.7 KB  |  192 lines

  1. XCOMM $OpenBSD: OpenBSDLib.rules,v 1.1 2000/10/09 20:43:58 matthieu Exp $
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  * OpenBSD shared library rules
  8.  */
  9.  
  10. XCOMM $XFree86: xc/config/cf/OpenBSDLib.rules,v 1.10 2003/10/31 20:49:03 herrb Exp $
  11.  
  12. #ifndef UseElfFormat
  13. #define UseElfFormat NO
  14. #endif
  15.  
  16. #ifndef HasSharedLibraries
  17. #define HasSharedLibraries YES
  18. #endif
  19. #ifndef ForceNormalLib
  20. #define ForceNormalLib YES
  21. #endif
  22.  
  23. #ifndef UseRpath
  24. #define UseRpath YES
  25. #endif
  26.  
  27. #ifndef BaseShLibReqs
  28. #define BaseShLibReqs        /* -lc implied by $(CC) */
  29. #endif
  30.  
  31. #ifndef SharedDataSeparation
  32. #define SharedDataSeparation NO
  33. #endif
  34. #ifndef SharedCodeDef
  35. #define SharedCodeDef /**/
  36. #endif
  37. #ifndef SharedLibraryDef
  38. #define SharedLibraryDef /**/
  39. #endif
  40. #ifndef ShLibIncludeFile
  41. #define ShLibIncludeFile <OpenBSDLib.tmpl>
  42. #endif
  43. #ifndef RpathLoadFlags
  44. #if UseRpath
  45. #define RpathLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
  46. #else
  47. #define RpathLoadFlags /**/
  48. #endif
  49. #endif
  50. #ifndef LibraryRpathLoadFlags
  51. #define LibraryRpathLoadFlags RpathLoadFlags
  52. #endif
  53. #ifndef SharedLibraryLoadFlags
  54. #define SharedLibraryLoadFlags -shared PositionIndependentCFlags LibraryRpathLoadFlags
  55. #endif
  56. #ifndef PositionIndependentCFlags
  57. #define PositionIndependentCFlags -fPIC
  58. #endif
  59. #ifndef PositionIndependentCplusplusFlags
  60. #define PositionIndependentCplusplusFlags -fPIC
  61. #endif
  62. #if UseElfFormat
  63. #ifndef ExtraLoadFlags
  64. #ifdef UseInstalled
  65. #define ExtraLoadFlags RpathLoadFlags
  66. #else
  67. #define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link,$(BUILDLIBDIR)
  68. #endif
  69. #endif
  70. #ifndef HardCodeLibdirFlag
  71. #define HardCodeLibdirFlag RpathLoadFlags
  72. #endif
  73. #endif /* UseElfFormat */
  74.  
  75. /*
  76.  * InstallSharedLibrary - generate rules to install the shared library.
  77.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  78.  */
  79. #ifndef InstallSharedLibrary
  80. #define InstallSharedLibrary(libname,rev,dest)                @@\
  81. install:: Concat(lib,libname.so.rev)                     @@\
  82.     MakeDir($(DESTDIR)dest)                        @@\
  83.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest
  84. #endif /* InstallSharedLibrary */
  85.  
  86. /*
  87.  * InstallSharedLibraryData - generate rules to install the shared library data
  88.  */
  89. #ifndef InstallSharedLibraryData
  90. #define InstallSharedLibraryData(libname,rev,dest)
  91. #endif /* InstallSharedLibraryData */
  92.  
  93.  
  94. /*
  95.  * SharedLibraryTarget - generate rules to create a shared library;
  96.  * build it into a different name so that we do not hose people by having
  97.  * the library gone for long periods.
  98.  */
  99. #ifndef SharedLibraryTarget
  100.  
  101. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  102. AllTarget(Concat(lib,libname.so.rev))                    @@\
  103.                                     @@\
  104. Concat(lib,libname.so.rev):  solist                    @@\
  105.     $(RM) $@~                            @@\
  106.     set -x; \                            @@\
  107.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$@\ @@\
  108.         solist $(REQUIREDLIBS) BaseShLibReqs);             @@\
  109.         LinkBuildSonameLibrary($@)                @@\
  110.     $(RM) $@                            @@\
  111.     $(MV) $@~ $@                            @@\
  112.                                     @@\
  113. clean::                                    @@\
  114.     $(RM) Concat(lib,libname.so.rev)
  115.  
  116. #endif /* SharedLibraryTarget */
  117.  
  118.  
  119. /*
  120.  * SharedDepLibraryTarget - generate rules to create a shared library.
  121.  */
  122. #ifndef SharedDepLibraryTarget
  123. #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  124. AllTarget(Concat(lib,libname.so.rev))                    @@\
  125.                                     @@\
  126. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  127.     $(RM) $@~                            @@\
  128.     (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
  129.     $(RM) $@                            @@\
  130.     $(MV) $@~ $@                            @@\
  131.     LinkBuildLibrary($@)                        @@\
  132.                                     @@\
  133. clean::                                    @@\
  134.     $(RM) Concat(lib,libname.so.rev)
  135.  
  136. #endif /* SharedDepLibraryTarget */
  137.  
  138. #ifndef SharedDepModuleTarget
  139. #define SharedDepModuleTarget(name,deps,solist)                @@\
  140. AllTarget(name)                                @@\
  141.                                     @@\
  142. name: deps                                @@\
  143.     $(RM) $@~                            @@\
  144.     $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)        @@\
  145.     $(RM) $@                            @@\
  146.     $(MV) $@~ $@                            @@\
  147.                                     @@\
  148. clean::                                    @@\
  149.     $(RM) name
  150.  
  151. #endif /* SharedDepModuleTarget */
  152.  
  153. #ifndef SharedDriModuleTarget
  154. #define SharedDriModuleTarget(name,deps,solist)                @@\
  155. AllTarget(name)                                @@\
  156.                                     @@\
  157. name: deps                                @@\
  158.     $(RM) $@~ $@.map                        @@\
  159.     $(CC) -o $@~  $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  160.     $(RM) $@ $@.map                            @@\
  161.     $(MV) $@~ $@                            @@\
  162.                                     @@\
  163. clean::                                    @@\
  164.     $(RM) name                            @@\
  165.     $(RM) name.map
  166.  
  167. #endif /* SharedDriModuleTarget */
  168.  
  169. /*
  170.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  171.  */
  172. #ifndef SharedLibraryDataTarget
  173. #define SharedLibraryDataTarget(libname,rev,salist)
  174. #endif /* SharedLibraryTarget */
  175.  
  176. /*
  177.  * DynamicModuleTarget - build a module to be dynamically loaded
  178.  */
  179. #ifdef DynamicModuleTarget
  180. #undef DynamicModuleTarget
  181. #define DynamicModuleTarget(module,modlist)                @@\
  182. AllTarget(module)                            @@\
  183.                                     @@\
  184. module: modlist                                @@\
  185.     RemoveFile($@)                            @@\
  186.     $(CC) -o $@ $(SHLIBLDFLAGS) modlist                @@\
  187.                                     @@\
  188. clean::                                    @@\
  189.     RemoveFile(module)
  190. #endif /* DynamicModuleTarget */
  191.  
  192.